﻿using System;
using System.Linq;
using System.Text.RegularExpressions;

namespace _7.ExtractsSentencesContainingGivenWord
{
    class ExtractsSentencesContainingGivenWord
    {
        static void Main(string[] args)
        {
            string text="We are living in a yellow submarine. We don't have anything else. Inside the submarine is very tight. So we are drinking all the day. We will move out of it in 5 days.";
            string[] sentences = text.Split('.');
            string word = @"\b(in)\b";
            Regex rgx = new Regex(word);
            for (int i = 0; i < sentences.Length; i++)
            {
                Match match = rgx.Match(sentences[i]);
                if (match.Success)
                {
                    Console.WriteLine(sentences[i]); 
                }
            }
        }
    }
}
